home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 January: Mac OS SDK / Dev.CD Jan 99 SDK1.toast / Development Kits / Interfaces&Libraries / Universal / Interfaces / PInterfaces / QD3DSet.p < prev    next >
Encoding:
Text File  |  1998-08-17  |  9.5 KB  |  268 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        QD3DSet.p
  3.  
  4.      Contains:    Q3Set types and routines                                            
  5.  
  6.      Version:    Technology:    Quickdraw 3D 1.5.4
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1995-1998 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. }
  17. {$IFC UNDEFINED UsingIncludes}
  18. {$SETC UsingIncludes := 0}
  19. {$ENDC}
  20.  
  21. {$IFC NOT UsingIncludes}
  22.  UNIT QD3DSet;
  23.  INTERFACE
  24. {$ENDC}
  25.  
  26. {$IFC UNDEFINED __QD3DSET__}
  27. {$SETC __QD3DSET__ := 1}
  28.  
  29. {$I+}
  30. {$SETC QD3DSetIncludes := UsingIncludes}
  31. {$SETC UsingIncludes := 1}
  32.  
  33. {$IFC UNDEFINED __QD3D__}
  34. {$I QD3D.p}
  35. {$ENDC}
  36.  
  37.  
  38. {$PUSH}
  39. {$ALIGN POWER}
  40. {$LibExport+}
  41.  
  42. {*****************************************************************************
  43.  **                                                                             **
  44.  **                                Set Routines                                 **
  45.  **                                                                             **
  46.  ****************************************************************************}
  47. FUNCTION Q3Set_New: TQ3SetObject; C;
  48. FUNCTION Q3Set_GetType(theSet: TQ3SetObject): TQ3ObjectType; C;
  49. FUNCTION Q3Set_Add(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  50. FUNCTION Q3Set_Get(theSet: TQ3SetObject; theType: TQ3ElementType; data: UNIV Ptr): TQ3Status; C;
  51. FUNCTION Q3Set_Contains(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Boolean; C;
  52. FUNCTION Q3Set_Clear(theSet: TQ3SetObject; theType: TQ3ElementType): TQ3Status; C;
  53. FUNCTION Q3Set_Empty(target: TQ3SetObject): TQ3Status; C;
  54. {
  55.  *  Iterating through all elements in a set
  56.  *
  57.  *  Pass in kQ3ElementTypeNone to get first type
  58.  *  kQ3ElementTypeNone is returned when end of list is reached
  59.  }
  60. FUNCTION Q3Set_GetNextElementType(theSet: TQ3SetObject; VAR theType: TQ3ElementType): TQ3Status; C;
  61.  
  62. {*****************************************************************************
  63.  **                                                                             **
  64.  **                                Attribute Types                                 **
  65.  **                                                                             **
  66.  ****************************************************************************}
  67.  *    For the data types listed below, pass in a pointer to it in the _Add 
  68.  *    and _Get calls.
  69.  *
  70.  *    For surface shader attributes, reference counts are incremented on 
  71.  *    the _Add and _Get 
  72.  }
  73.  
  74. TYPE
  75.     TQ3AttributeTypes             = LONGINT;
  76. CONST
  77.                                                                 {  Data Type                 }
  78.     kQ3AttributeTypeNone        = {TQ3AttributeTypes}0;            {  ---------                 }
  79.     kQ3AttributeTypeSurfaceUV    = {TQ3AttributeTypes}1;            {  TQ3Param2D                 }
  80.     kQ3AttributeTypeShadingUV    = {TQ3AttributeTypes}2;            {  TQ3Param2D                  }
  81.     kQ3AttributeTypeNormal        = {TQ3AttributeTypes}3;            {  TQ3Vector3D                  }
  82.     kQ3AttributeTypeAmbientCoefficient = {TQ3AttributeTypes}4;    {  float                      }
  83.     kQ3AttributeTypeDiffuseColor = {TQ3AttributeTypes}5;        {  TQ3ColorRGB                 }
  84.     kQ3AttributeTypeSpecularColor = {TQ3AttributeTypes}6;        {  TQ3ColorRGB                 }
  85.     kQ3AttributeTypeSpecularControl = {TQ3AttributeTypes}7;        {  float                     }
  86.     kQ3AttributeTypeTransparencyColor = {TQ3AttributeTypes}8;    {  TQ3ColorRGB                 }
  87.     kQ3AttributeTypeSurfaceTangent = {TQ3AttributeTypes}9;        {  TQ3Tangent2D               }
  88.     kQ3AttributeTypeHighlightState = {TQ3AttributeTypes}10;        {  TQ3Switch                  }
  89.     kQ3AttributeTypeSurfaceShader = {TQ3AttributeTypes}11;        {  TQ3SurfaceShaderObject     }
  90.     kQ3AttributeTypeNumTypes    = {TQ3AttributeTypes}12;
  91.  
  92.  
  93. TYPE
  94.     TQ3AttributeType                    = TQ3ElementType;
  95. {*****************************************************************************
  96.  **                                                                             **
  97.  **                                Attribute Drawing                             **
  98.  **                                                                             **
  99.  ****************************************************************************}
  100. FUNCTION Q3Attribute_Submit(attributeType: TQ3AttributeType; data: UNIV Ptr; view: TQ3ViewObject): TQ3Status; C;
  101.  
  102. {*****************************************************************************
  103.  **                                                                             **
  104.  **                            AttributeSet Routines                             **
  105.  **                                                                             **
  106.  ****************************************************************************}
  107. FUNCTION Q3AttributeSet_New: TQ3AttributeSet; C;
  108. FUNCTION Q3AttributeSet_Add(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  109. FUNCTION Q3AttributeSet_Contains(attributeSet: TQ3AttributeSet; attributeType: TQ3AttributeType): TQ3Boolean; C;
  110. FUNCTION Q3AttributeSet_Get(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType; data: UNIV Ptr): TQ3Status; C;
  111. FUNCTION Q3AttributeSet_Clear(attributeSet: TQ3AttributeSet; theType: TQ3AttributeType): TQ3Status; C;
  112. FUNCTION Q3AttributeSet_Empty(target: TQ3AttributeSet): TQ3Status; C;
  113. {
  114.  * Q3AttributeSet_GetNextAttributeType
  115.  *
  116.  * Pass in kQ3AttributeTypeNone to get first type
  117.  * kQ3AttributeTypeNone is returned when end of list is reached
  118.  }
  119. FUNCTION Q3AttributeSet_GetNextAttributeType(source: TQ3AttributeSet; VAR theType: TQ3AttributeType): TQ3Status; C;
  120. FUNCTION Q3AttributeSet_Submit(attributeSet: TQ3AttributeSet; view: TQ3ViewObject): TQ3Status; C;
  121. {
  122.  * Inherit from parent->child into result
  123.  *    Result attributes are:
  124.  *        all child attributes + all parent attributes NOT in the child
  125.  }
  126. FUNCTION Q3AttributeSet_Inherit(parent: TQ3AttributeSet; child: TQ3AttributeSet; result: TQ3AttributeSet): TQ3Status; C;
  127.  
  128. {*****************************************************************************
  129.  **                                                                             **
  130.  **                            Custom Element Registration                         **
  131.  **                                                                             **
  132.  ****************************************************************************}
  133. {
  134.  * Element Methods - 
  135.  *
  136.  *         When you create a custom element, you control what structures are 
  137.  *        passed around the API. For example, you may allow the Q3Set_Add call 
  138.  *        take one type of argument, store your element internally in some 
  139.  *        abstract data type, and have the Q3Set_Get call take a different 
  140.  *        argument.
  141.  *
  142.  *        For example:
  143.  *            
  144.  *        There are four calls which at some point will copy an element:
  145.  *
  146.  *        Q3Set_Add (copied from Application memory to QuickDraw3D memory)
  147.  *        Q3Set_Get (copied from QuickDraw3D memory to Application memory)
  148.  *        Q3Object_Duplicate (all elements are copied internally)
  149.  *        Q3AttributeSet_Inherit (all elements are copied internally)
  150.  *
  151.  *         Either CopyAdd or CopyReplace is called during the "_Add" call.
  152.  *            - CopyAdd is destructive and should assume "toElement" is garbage
  153.  *            - CopyReplace is replacing an existing element.
  154.  *
  155.  *         CopyGet is called during the "_Get" call.
  156.  *
  157.  *         CopyDuplicate is called to duplicate an element's internal structure.
  158.  *
  159.  * Attributes Methods - 
  160.  *
  161.  *        For copying data while Inheriting. Element methods are used
  162.  *        at all other times.
  163.  *    
  164.  *         CopyInherit is called to duplicate an element's internal structure 
  165.  *            during inheritance. You should make this as fast as possible.
  166.  *            (for example, if your custom element contains objects, you
  167.  *             should do a Q3Shared_GetReference instead of a Q3Object_Duplicate)
  168.  *            
  169.  *        The ElementDelete method will be called for all of your elements 
  170.  *        copied around via CopyAdd, CopyReplace, CopyDuplicate, and 
  171.  *        CopyInherit.
  172.  *        If CopyGet allocates any memory in it's destination, it is up to the 
  173.  *        application to delete it on its side.
  174.  }
  175.  
  176. CONST
  177.     kQ3XMethodTypeElementCopyAdd = 'ecpa';
  178.     kQ3XMethodTypeElementCopyReplace = 'ecpr';
  179.     kQ3XMethodTypeElementCopyGet = 'ecpg';
  180.     kQ3XMethodTypeElementCopyDuplicate = 'eccd';
  181.     kQ3XMethodTypeElementDelete    = 'ecpl';
  182.  
  183.  
  184. TYPE
  185. {$IFC TYPED_FUNCTION_POINTERS}
  186.     TQ3XElementCopyAddMethod = FUNCTION(fromAPIElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C;
  187. {$ELSEC}
  188.     TQ3XElementCopyAddMethod = ProcPtr;
  189. {$ENDC}
  190.  
  191. {$IFC TYPED_FUNCTION_POINTERS}
  192.     TQ3XElementCopyReplaceMethod = FUNCTION(fromAPIElement: UNIV Ptr; ontoInternalElement: UNIV Ptr): TQ3Status; C;
  193. {$ELSEC}
  194.     TQ3XElementCopyReplaceMethod = ProcPtr;
  195. {$ENDC}
  196.  
  197. {$IFC TYPED_FUNCTION_POINTERS}
  198.     TQ3XElementCopyGetMethod = FUNCTION(fromInternalElement: UNIV Ptr; toAPIElement: UNIV Ptr): TQ3Status; C;
  199. {$ELSEC}
  200.     TQ3XElementCopyGetMethod = ProcPtr;
  201. {$ENDC}
  202.  
  203. {$IFC TYPED_FUNCTION_POINTERS}
  204.     TQ3XElementCopyDuplicateMethod = FUNCTION(fromInternalElement: UNIV Ptr; toInternalElement: UNIV Ptr): TQ3Status; C;
  205. {$ELSEC}
  206.     TQ3XElementCopyDuplicateMethod = ProcPtr;
  207. {$ENDC}
  208.  
  209. {$IFC TYPED_FUNCTION_POINTERS}
  210.     TQ3XElementDeleteMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Status; C;
  211. {$ELSEC}
  212.     TQ3XElementDeleteMethod = ProcPtr;
  213. {$ENDC}
  214.  
  215. FUNCTION Q3XElementClass_Register(VAR elementType: TQ3ElementType; name: ConstCStringPtr; sizeOfElement: UInt32; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  216. FUNCTION Q3XElementType_GetElementSize(elementType: TQ3ElementType; VAR sizeOfElement: UInt32): TQ3Status; C;
  217.  
  218. {*****************************************************************************
  219.  **                                                                             **
  220.  **                        Custom Attribute Registration                         **
  221.  **                                                                             **
  222.  ****************************************************************************}
  223.  
  224. TYPE
  225.     TQ3XAttributeInheritMethod            = TQ3Boolean;
  226. { return kQ3True or kQ3False in your metahandler }
  227. {$IFC TYPED_FUNCTION_POINTERS}
  228.     TQ3XAttributeCopyInheritMethod = FUNCTION(fromInternalAttribute: UNIV Ptr; toInternalAttribute: UNIV Ptr): TQ3Status; C;
  229. {$ELSEC}
  230.     TQ3XAttributeCopyInheritMethod = ProcPtr;
  231. {$ENDC}
  232.  
  233. FUNCTION Q3XAttributeClass_Register(VAR attributeType: TQ3AttributeType; creatorName: ConstCStringPtr; sizeOfElement: UInt32; metaHandler: TQ3XMetaHandler): TQ3XObjectClass; C;
  234. {
  235.  *    Version 1.5
  236.  }
  237.  
  238. TYPE
  239. {$IFC TYPED_FUNCTION_POINTERS}
  240.     TQ3XAttributeDefaultMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Status; C;
  241. {$ELSEC}
  242.     TQ3XAttributeDefaultMethod = ProcPtr;
  243. {$ENDC}
  244.  
  245. {$IFC TYPED_FUNCTION_POINTERS}
  246.     TQ3XAttributeIsDefaultMethod = FUNCTION(internalElement: UNIV Ptr): TQ3Boolean; C;
  247. {$ELSEC}
  248.     TQ3XAttributeIsDefaultMethod = ProcPtr;
  249. {$ENDC}
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257. {$ALIGN RESET}
  258. {$POP}
  259.  
  260. {$SETC UsingIncludes := QD3DSetIncludes}
  261.  
  262. {$ENDC} {__QD3DSET__}
  263.  
  264. {$IFC NOT UsingIncludes}
  265.  END.
  266. {$ENDC}
  267.